package cn.naughtior.shch.utils;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.rabbit.support.CorrelationData;

/**
 * ${DESCRIPTION}
 *
 * @author shitou<shitou@in66.com>
 * @create 2017-01-16 16:34
 */

public class ConfirmHandler implements RabbitTemplate.ConfirmCallback{
    @Override
    public void confirm(CorrelationData correlationData, boolean ack) {
        if (ack) {
            System.out.println("消息确认成功");
        } else {
            //处理丢失的消息（nack）
            System.out.println("消息确认失败");
        }
    }
}
